home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995…tember: Reference Library / Dev.CD Sep 95 RL / Dev.CD Sep 95 RL.toast / mac / Technical Documentation / develop / develop Issue 6 code / TCP / NewsWatcher / NW Source / Source / ldefstub.c < prev    next >
Encoding:
Text File  |  1994-07-18  |  1.2 KB  |  39 lines  |  [TEXT/MMCC]

  1. /*----------------------------------------------------------------------------
  2.  
  3.     ldefstub.c
  4.  
  5.     This module contains a stub for NewsWatcher's LDEF.
  6.     
  7.     This module is compiled by the ldef.π project to build the stand-alone
  8.     LDEF 128 resource.
  9.     
  10.     This is only a very small stub used to call the main LDEF function in
  11.     the ldef.c module, which is part of the main newswatcher.π project.
  12.     
  13.     A UPP to the main LDEF function must be stored in the list record's
  14.     refcon field.
  15.     
  16.     Using the stub has two advantages:
  17.     
  18.     1. The main LDEF function can use global variables, call other functions,
  19.     and in general enjoy all the privileges of a "real" function as opposed
  20.     to a function in a stand-alone code resource.
  21.     
  22.     2. We don't have to remember to rebuild the stand alone LDEF resource
  23.     whenever we make changes to the data structures in glob.h.
  24.     
  25. ----------------------------------------------------------------------------*/
  26.  
  27.  
  28. pascal void    main (short lMessage, Boolean lSelect, Rect *lRect, Cell lCell,
  29.     short lDataOffset, short lDataLen, ListHandle lHandle)
  30. {
  31.     ListDefUPP listDefFuncUPP;
  32.     
  33.     if (lMessage == lInitMsg) return;
  34.     listDefFuncUPP = (ListDefUPP)(**lHandle).refCon;
  35.     CallListDefProc(listDefFuncUPP, lMessage, lSelect, lRect, lCell, 
  36.         lDataOffset, lDataLen, lHandle);
  37. }
  38.  
  39.